package rachauto.persistence.jpa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import rdvmedecins.jpa.Client;

/**
 * The persistent class for the CANDIDAT database table.
 * 
 */
@Entity
public class Candidat implements GenericEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	private String adresse;

	private String cin;

	@Temporal(TemporalType.DATE)
	@Column(name = "DATE_NAISSANCE")
	private Date dateNaissance;

	private String email;

	private String nom;

	@Column(name = "NUM_TELE")
	private String numTele;

	private String prenom;

	@Version
	private int version;

	public Candidat() {
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getAdresse() {
		return this.adresse;
	}

	public void setAdresse(String adresse) {
		this.adresse = adresse;
	}

	public String getCin() {
		return this.cin;
	}

	public void setCin(String cin) {
		this.cin = cin;
	}

	public Date getDateNaissance() {
		return this.dateNaissance;
	}

	public void setDateNaissance(Date dateNaissance) {
		this.dateNaissance = dateNaissance;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getNom() {
		return this.nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getNumTele() {
		return this.numTele;
	}

	public void setNumTele(String numTele) {
		this.numTele = numTele;
	}

	public String getPrenom() {
		return this.prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	@Override
	public int hashCode() {
		Long id = getId();
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		if (!(object instanceof Candidat)) {
			return false;
		}
		Client other = (Client) object;
		if ((this.getId() == null && other.getId() != null)
				|| (this.getId() != null && !this.getId().equals(other.getId()))) {
			return false;
		}
		return true;
	}

	public Candidat(String nom, 
					String prenom, 
					String cin, 
					String numTele,
					Date dateNaissance,
					String email,
					String adresse) {
		this.adresse = adresse;
		this.email = email;
		this.dateNaissance = dateNaissance;
		this.nom = nom;
		this.prenom = prenom;
		this.numTele = numTele;
		this.cin = cin;
	}

}